<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>待办任务</title>
</head>
<body>
	<%@ include file="/WEB-INF/jsp/common/header.jsp"%>
	<script type="text/javascript">
		function claim() {
			$.messager.alert('Warning', 'The warning message');
		}
	</script>
	<script>
		$(function() {
			bindgrid();
		});
		function bindgrid() {
			var userid = PUser.userid;
			$('#tt')
					.datagrid(
							{
								title : '待办事务',
								url : 'ActivitiManage/PendingTaskListJson?userid='
										+ userid,
								iconCls : 'icon-application',
								width : 900,
								height : 500,
								nowrap : true,
								rownumbers : true,
								animate : false,
								collapsible : false,
								singleSelect : true,
								remoteSort : false,
								columns : [ [
										{
											field : 'CATEGORY_',
											title : '流程类别',
											// 							sortable : true,
											width : 150,
											formatter : function(val, rec) {
												return unescape(val)
											}
										},
										{
											field : 'NAME_',
											title : '流程名称',
											// 							sortable : true,
											width : 150,
											formatter : function(val, rec) {
												return unescape(val)
											}
										},
										{
											field : 'taskname',
											title : '当前节点',
											width : 150
										},
										{
											field : 'CREATE_TIME_',
											title : '创建时间',
											width : 160,
											formatter : function(val, rec) {
												return unescape(val)
											}
										},
										{
											field : 'claim',
											title : '',
											width : 50,
											formatter : function(val, rec) {
												var btn = '<a href="javascript:claim()">签收</a>';
												return btn;
											}
										},
										{
											field : 'Transfer',
											title : '',
											width : 50,
											formatter : function(val, rec) {
												var btn = '<a href="javascript:transfer()">转交</a>';
												return btn;
											}
										},
										{
											field : 'commit',
											title : '',
											width : 50,
											formatter : function(val, rec) {
												var btn = '<a href="javascript:commit()">提交</a>';
												return btn;
											}
										},
										{
											field : 'goback',
											title : '',
											width : 50,
											formatter : function(val, rec) {
												var btn = '<a href="javascript:goback()">退回</a>';
												return btn;
											}
										},
										{
											field : 'wfimg',
											title : '',
											width : 50,
											formatter : function(val, rec) {
												var btn = '<a href="ActivitiMain/WFImg?devid='
														+ rec.devid
														+ '&taskid='
														+ rec.taskid
														+ '" target="_blank">流程图</a>';
												return btn;
											}
										} ] ],
								toolbar : [],
								onLoadSuccess : function() {
								},
								onDblClickRow : function() {
									// 							editrow();
								}
							});
		}
	</script>
	<table id="tt" style="height: 500px;"></table>
</body>
</html>